# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Aaron Fischer <mail@aaron-fischer.net>
# Contributor: Steven Allen <steven@stebalien.com>
# Contributor: trile7 at gmail dot com
# Contributor: Ernia <monghitri@aruba.it>

pkgname=yad
pkgver=13.0
pkgrel=2
pkgdesc='A fork of zenity - display graphical dialogs from shell scripts or command line'
url='https://github.com/v1cont/yad'
arch=('loong64' 'x86_64')
license=('GPL3')
depends=('gtk3' 'webkit2gtk-4.1' 'gtksourceview3' 'gspell')
makedepends=('autoconf' 'automake' 'intltool')
source=("https://github.com/v1cont/yad/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.xz")
sha256sums=('194198c4a58e20ceffd9a3206633c3726d962d7d4219edb77aeb748897403e34')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # use webkit2gtk-4.1
  sed -i 's|webkit2gtk-4.0|webkit2gtk-4.1|' configure.ac

  autoreconf -ivf
  intltoolize
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure \
    --prefix=/usr \
    --enable-icon-browser \
    --enable-html \
    --enable-spell \
    --enable-sourceview

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
